﻿<Window x:Class="P2.Cuberry.Modules.SimpleAccounting.FiAccount.FiAccountsDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    xmlns:basec="clr-namespace:P2.Cuberry.Framework.Helper;assembly=P2.Cuberry.Framework.Helper"    
        
        Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Title="Peacequare Cuberry" Width="920" Height="480" 
        Background="{DynamicResource P2BackgroundBrush}" 
         Closing="Window_Closing"
        >

    <Window.Resources>
       <ResourceDictionary>            
            <ResourceDictionary.MergedDictionaries>                
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>              
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
        
    </Window.Resources>

    <Grid>
        <Grid.Resources>
            
            <Image x:Key="AddChildIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiAccount;component/Images/AddChild.png" />
            <Image x:Key="AddRootIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiAccount;component/Images/AddRoot.png" />
            <Image x:Key="ArrowDownIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiAccount;component/Images/MoveDown.ico" />

            <Image x:Key="ArrowUpIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiAccount;component/Images/MoveUp.ico" />
                        
            <Image x:Key="Activate" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiAccount;component/Images/Activate.ico" />
            <Image x:Key="Pause" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiAccount;component/Images/Pause.ico" />
            <Image x:Key="Remove" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiAccount;component/Images/Remove.ico" />
            
        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Content="{Translate DialogHeaderFiAccountDetail}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />
        
        
        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Grid >
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}" >
                <MenuItem x:Name="SaveBtn"  Margin="2,1,0,2"  InputGestureText="Ctrl+S" Header="{Translate SaveBtn}" Command="{Binding FiAccountSaveCommand}"  Style="{StaticResource P2MenuItemStyleSave}" />
                <MenuItem x:Name="CloseBtn" Margin="2,1,0,2" InputGestureText="Ctrl+X" Header="{Translate SaveAndCloseBtn}" Command="{Binding FiAccountCloseCommand}" Style="{StaticResource P2MenuItemStyleSaveAndClose}"/>
                
                <MenuItem x:Name="AddRootBtn" Margin="2,1,0,2" Header="{Translate AddRootBtn}" Command="{Binding FiAccountAddRootCommand}" Icon="{StaticResource AddRootIcon}" Style="{StaticResource P2MenuItemStyle}"/>

                <MenuItem x:Name="AddChildBtn" Margin="2,1,0,2" Header="{Translate AddChildBtn}" Command="{Binding FiAccountAddChildCommand}" Icon="{StaticResource AddChildIcon}" Style="{StaticResource P2MenuItemStyle}" />
                <MenuItem x:Name="MoveUpBtn" Margin="2,1,0,2" Header="{Translate MoveUpBtn}" Command="{Binding FiAccountMoveUpCommand}" Icon="{StaticResource ArrowUpIcon}" Style="{StaticResource P2MenuItemStyle}" />
                <MenuItem x:Name="MoveDownBtn" Margin="2,1,0,2" Header="{Translate MoveDownBtn}" Command="{Binding FiAccountMoveDownCommand}" Icon="{StaticResource ArrowDownIcon}" Style="{StaticResource P2MenuItemStyle}"/>
                
                <MenuItem x:Name="ActivateBtn" Margin="2,1,0,2" Header="{Translate ActivateBtn}" Command="{Binding FiAccountActivateCommand}" Icon="{StaticResource Activate}" Style="{StaticResource P2MenuItemStyle}"  />
                <MenuItem x:Name="LockBtn" Margin="2,1,0,2" Header="{Translate LockBtn}" Command="{Binding FiAccountLockCommand}" Icon="{StaticResource Pause}" Style="{StaticResource P2MenuItemStyle}"  />
                <MenuItem x:Name="DeleteBtn" Margin="2,1,0,2" Header="{Translate DeleteBtn}" Command="{Binding FiAccountDeleteCommand}" Icon="{StaticResource Remove}" Style="{StaticResource P2MenuItemStyle}"  />
                
                <MenuItem x:Name="PrintBtn" Margin="2,1,0,2" Header="{Translate PrintBtn}" Click="PrintBtn_Click" Style="{StaticResource P2MenuItemStylePrint}"/>
            </Menu>
                <Menu Grid.Row="1" HorizontalAlignment="Right" x:Name="menuMainRight" Style="{StaticResource P2MenuStyle}" >
                    <MenuItem x:Name="HistoryBtn" Command="{Binding HistoryCommand}"  Style="{StaticResource P2MenuItemStyleHistory}"/>
                    <MenuItem x:Name="InfoBtn" Command="{Binding InfoCommand}"  Style="{StaticResource P2MenuItemStyleInfo}"/>                    
                </Menu>
            </Grid>
        </Border>


        <!-- Row 1 End -->

        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid Grid.Row="2" Grid.Column="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="350*"/>
                    <ColumnDefinition Width="350*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <Label HorizontalAlignment="Left" Margin="5,15.827,0,0" Name="AccountTreeL" Width="120" Height="28" VerticalAlignment="Top" Content="{Translate AccountSortingL}"></Label>
                <TreeView HorizontalAlignment="Stretch" Margin="5,36,5,5" Name="AccountTree" MouseDoubleClick="AccountTree_MouseDoubleClick" SelectedItemChanged="AccountTree_SelectedItemChanged" MinWidth="270" MinHeight="280" />


                <Label Grid.Row="2" Grid.Column="1" Height="28" Margin="5,16.143,187,0" Name="FiAccountNoL" VerticalAlignment="Top" Content="{Translate fiAccountNoL}"></Label>
                <TextBox Grid.Row="2" Grid.Column="1" Height="23" Margin="5,36,137,0" Name="FiAccountNo" Text="{Binding FiAccountNo , ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" 
                         IsReadOnly="{Binding FiAccountNoReadOnly}" VerticalAlignment="Top" Style="{StaticResource P2TextBoxStyle}" />

                <Label Grid.Row="2" Grid.Column="1" Height="28" Margin="0,16.143,11,0" Name="FiAccountTypeIDL" VerticalAlignment="Top" Content="{Translate fiAccountTypeIDL}" HorizontalAlignment="Right" Width="120"></Label>
                <ComboBox Grid.Row="2" Grid.Column="1" Height="23" Margin="0,36,11,0" Name="FiAccountTypeID" SelectedValuePath="FiAccountTypeID" DisplayMemberPath="FiAccountTypeNameCur"   SelectedValue="{Binding FiAccountTypeID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"  Validation.ErrorTemplate="{StaticResource ErrorTemplate}" 
                          IsEnabled="{Binding FiAccountNameEnabled}"
                          ItemsSource="{Binding AccountTypes}"
                          Style="{StaticResource P2ComboBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Right" Width="120" />
                
                <TextBox Grid.Column="1" Margin="5,63,261,0" Text="{Binding FiAccountBalanceTypeName, Mode=OneWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Name="FiAccountBalanceType" Height="23" VerticalAlignment="Top" IsEnabled="False" />
                <TextBox Grid.Column="1" Margin="0,63,137,0" HorizontalAlignment="Right" Width="120" Text="{Binding FiAccountCategoryName, Mode=OneWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Name="FiAccountCategory" Height="23" VerticalAlignment="Top" IsEnabled="False" />
                <TextBox Grid.Column="1" Margin="0,63,11,0" HorizontalAlignment="Right" Width="120" Text="{Binding FiAccountPostingTypeName, Mode=OneWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Name="FiAccountPostingTypex" Height="23" VerticalAlignment="Top" IsEnabled="False" />
                
                <Label Grid.Column="1" Margin="5,87,187,0" Name="FiAccountNameEnL" Height="28" VerticalAlignment="Top" Content="{Translate fiAccountNameEnL}"></Label>
                <TextBox Grid.Column="1" Margin="5,108,5,0" Name="FiAccountNameEn" Height="23" Text="{Binding FiAccountNameEn, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" 
                         IsReadOnly="{Binding FiAccountNameReadOnly}"
                         Style="{StaticResource P2TextBoxStyle}" FlowDirection="LeftToRight" VerticalAlignment="Top" />

                <Label Grid.Column="1" Margin="5,138,187,0" Name="FiAccountNameArL" Height="28" Content="{Translate fiAccountNameArL}" VerticalAlignment="Top"></Label>
                <TextBox Grid.Column="1" Margin="5,157,5,0" Name="FiAccountNameAr" Height="23" Text="{Binding FiAccountNameAr, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" 
                         IsReadOnly="{Binding FiAccountNameReadOnly}"
                         Style="{StaticResource P2TextBoxStyle}" FlowDirection="RightToLeft" VerticalAlignment="Top" />


                <Label Grid.Row="2" Grid.Column="1" Margin="5,0,187,70" Name="ParentFiAccountIDL" Content="{Translate ParentAccountL}" Height="28" VerticalAlignment="Bottom"></Label>
                <TextBox Grid.Row="2" Grid.Column="1" Margin="5,0,137,49" Name="ParentFiAccountID"  Text="{Binding ParentFiAccountFullName, Mode=OneWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  Height="23" VerticalAlignment="Bottom" IsEnabled="False" />

                <Label Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,4.623,70" Name="FiAccountLevelL" Width="120" Content="{Translate AccountLevelL}" Height="28" VerticalAlignment="Bottom"></Label>
                <TextBox Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,5,49" Text="{Binding FiAccountLevel, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Name="FiAccountLevel" Width="120.783" Height="23" VerticalAlignment="Bottom" IsEnabled="False" />

                
                <Label Grid.Row="2" Grid.Column="1" Margin="5,0,187,21" Name="FiAccountFiscalYearL" Height="28" VerticalAlignment="Bottom" Content="{Translate fiAccountFiscalYearIDL}"></Label>
                <ComboBox Grid.Row="2" Grid.Column="1" Margin="5,0,137,4" Name="FiAccountFiscalYear" 
                          ItemsSource="{Binding FiscalYears}"
                          SelectedValue="{Binding FiAccountFiscalYearID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" IsEditable="{Binding FiFiscalYearEditable}"  Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2ComboBoxStyle}" SelectedValuePath="FiscalYearID" DisplayMemberPath="FiscalYearName" Height="23" VerticalAlignment="Bottom" IsEnabled="False" />
                
                <CheckBox Grid.Row="2" Grid.Column="1" Margin="0,0,6,6" Name="Chargeable" IsChecked="{Binding Chargeable}" Content="{Translate fiAccountChargeableL}" Height="16" VerticalAlignment="Bottom" IsEnabled="False" HorizontalAlignment="Right" Width="118.623" />

            </Grid>
        </Border>

        <!-- Row 2: End -->


        <!-- Row 3: Bottom: Status Bar Start -->
        <Border Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripBorderStyle}" >
            <Grid Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripGridStyle}">
                <basec:P2StatusStrip x:Name="StatusStrip" MessageStack2="{Binding MessageStack}"  Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Left" ContentStringFormat=""></basec:P2StatusStrip>
                <TextBox Name="Status" Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Right" Text="{Binding StatusName, Mode=OneWay}" IsReadOnly="True" BorderBrush="Transparent" />
            </Grid>
        </Border>

        <!-- Row 3: End -->
    </Grid>
</Window>
